$(function (){
	$("#content").on('click', function (e) {
		//当前点击的目标
		var obj = $(e.target);
		var name = obj.attr('name')
		console.log(name)
		switch(name) {
			case "add_user":
				add_user(obj)
			break;
			case "edit_user":
				
			break;
			case "remove_user":
				
			break;
			case "submit_user_info":
				//保存员工信息
				submit_user_info();
			break;
		}
	});
	$("#employee_role").searchableSelect();
	$("#employee_department").searchableSelect();
})


/*
*	新增员工
*/
function add_user(obj) {
	
}

/*
*	新增员工
*/
function submit_user_info(obj) {
	employee_name = $("#employee_name").val();
	employee_no = $("#employee_no").val();
	user_password = $("#user_password").val();
	employee_email = $("#employee_email").val();
	employee_department = $("#employee_department").val();
	employee_role = $("#employee_role").val();

	base.post(
		'/system/usermanage/', 
		{
			employee_name: employee_name,
			employee_no: employee_no,
			user_password: user_password,
			employee_email: employee_email,
			employee_department: employee_department,
			employee_role: employee_role,
		}, 
		function(data){

		}
	)
	
}
